#########################################################################
##
## This file is part of the SAMRAI distribution.  For full copyright 
## information, see COPYRIGHT and LICENSE. 
##
## Copyright:     (c) 1997-2019 Lawrence Livermore National Security, LLC
## Description:   makefile for the entire SAMRAI distribution 
##
#########################################################################

SRCDIR = @srcdir@
SAMRAI = @top_srcdir@
OBJECT = ..
SUBDIR = docs
VPATH = @SRCDIR@

include $(OBJECT)/config/Makefile.config

Doxyfile: $(SRCDIR)/Doxyfile.in $(OBJECT)/config.status
	cd $(OBJECT) \
	  && CONFIG_FILES=$(SUBDIR)/$@ CONFIG_HEADERS= $(SHELL) ./config.status --file=$(SUBDIR)/$@
dox: Doxyfile doxygenBinaryWarning
	@mkdir -p @dox_output_dir@.
	@DOXYGEN_BIN@ Doxyfile
	@echo "# $@ was updated at `date` using this Doxyfile:" > $@
	cat Doxyfile >> $@
	cp @dox_output_dir@samrai.tag @dox_output_dir@samrai-dox/html/samrai.tag
	@echo "Created documentation in @dox_output_dir@"
redox:
	$(RM) dox && $(MAKE) dox

devDoxyfile: $(SRCDIR)/devDoxyfile.in $(OBJECT)/config.status
	cd $(OBJECT) \
	  && CONFIG_FILES=$(SUBDIR)/$@ CONFIG_HEADERS= $(SHELL) ./config.status --file=$(SUBDIR)/$@
devdox: devDoxyfile doxygenBinaryWarning
	@mkdir -p @dox_output_dir@.
	@DOXYGEN_BIN@ devDoxyfile
	@echo "# $@ was updated at `date` using this Doxyfile:" > $@
	cat devDoxyfile >> $@
	cp @dox_output_dir@samrai-dev.tag @dox_output_dir@samrai-devdox/html/samrai.tag
	@echo "Created documentation in @dox_output_dir@"
redevdox:
	$(RM) devdox && $(MAKE) devdox

grey-dox-bg:
	@cd @dox_output_dir@.
	@files="`echo samrai*dox/html/doxygen.css`"
	@if test -n "$${files}"; then	\
	  echo "Making html background grey"; \
	  for i in $${files}; do	\
	    echo 'body { background: #bbbbbb; }' >> $${i}	;\
	  done	;\
	fi

doxygenBinaryWarning:
	@if test -z "@DOXYGEN_BIN@"; then	\
	  echo "Missing doxygen binary.  Please use --with-doxygen=PATH with configure." >&1	;\
	  exit 1	;\
	fi
	@echo "Warning: try to use the most recent version of doxygen.  Older versions have been known to hang."
